﻿namespace NGen.Managers.GameState
{
	public delegate void GameStateChangedEventHandler(string p_newStateName);

	/// <summary>
	/// 	Interface between a GameStateObject and the GameStateManager
	/// </summary>
	public interface IManagerGameState : IGameManager
	{
		#region properties

		/// <summary>
		/// 	Returns the top state name, if there is a state on the stack. Empty
		/// 	string if no state on the stack
		/// </summary>
		string CurrentStateName { get; }

		GameState StartingState { get; set; }

		event GameStateChangedEventHandler GameStateChangedEvent;

		#endregion

		#region local methods

		/// <summary>
		/// 	Push a new state onto the stack
		/// </summary>
		/// <param name = "p_newState">name of the state to push</param>
		void PushState(GameState p_newState);

		/// <summary>
		/// 	<para>Pop the top state from the stack.</para>
		/// 	<para>Does nothing if there are no states on the stack</para>
		/// </summary>
		void PopState(bool p_clearStack = false);

		/// <summary>
		/// 	Called by StateObjects to change the engine to a new state
		/// </summary>
		/// <param name = "p_newState">string value of the new state</param>
		/// <param name = "p_clearStack">clear the stack</param>
		void ChangeState(GameState p_newState, bool p_clearStack = false);

		#endregion
	}
}